(ns pe.p12
  (:use pe.triangles))

(defn divides? [a x]
  (zero? (rem a x)))

(defn divisors [a]
  (let [divs (mapcat identity (for [x (range 1 (Math/sqrt a)) :when (divides? a x)] [x (quot a x)]))]
    (do
      (println a (count divs))
      divs)))

;(println (divisors 28))
(println (first (drop-while #(<= (count (divisors %)) 500) (tr-seq))))
